package com.leetcode.LC;

public class LC342 {
    public boolean isPowerOfFour(int n) {
        if (n == 0) {
            return false;
        }

        while (n != 0) {
            if (n == 1) {
                return true;
            } else if (n % 4 != 0) {
                return false;
            }
            n = n / 4;
        }
        return true;
    }

}
